---
export interface Props {
  src: string;
}

const { src } = Astro.props as Props;

const files = await import.meta.glob<string>("/src/svg/**/*.svg", {
  as: "raw",
});

const path = `/src/svg/${src}.svg`;
const getHTML = files[path];
if (getHTML === undefined) {
  throw new Error(`${src} is not valid`);
}
const innerHTML = await getHTML();
---

<Fragment set:html={innerHTML} />
